package com.vibration.matlab;

import com.mathworks.toolbox.javabuilder.MWClassID;
import com.mathworks.toolbox.javabuilder.MWException;
import com.mathworks.toolbox.javabuilder.MWNumericArray;
import com.mathworks.toolbox.javabuilder.MWStructArray;
import random_search_cal.Search;

import java.beans.IntrospectionException;

/**
 * 得到第一次随机数据
 */
public class GetRandomSearch {

    /**
     * 测试search_random 输出L2i,pass,mod,DCT,HVT
     *                  输入A,C,G,MM,INPO,ini1,pass
     */
    public  static Object[] getRandomSearch(A a, C c, G g, int MM, int INPO, double[][] ini1, double pass, double[][] ProbLimSupSegHHS, double[][] LimVelSegHHS) throws MWException, IntrospectionException {
        pass=1.0;
        MM=1;
        MWStructArray  matA = MWStructArray.fromBean(a);
        MWStructArray  matC = MWStructArray.fromBean(c);
        MWStructArray  matG = MWStructArray.fromBean(g);
        //转矩阵
        MWNumericArray matArr = new MWNumericArray(ini1, MWClassID.DOUBLE);
        MWNumericArray matArr1 = new MWNumericArray(ProbLimSupSegHHS, MWClassID.DOUBLE);
        MWNumericArray matArr2 = new MWNumericArray(LimVelSegHHS, MWClassID.DOUBLE);
        Search search=new Search();
        Object[] res=search.random_search_cal(5,matA,matC,matG,MM,INPO,matArr,pass,matArr1,matArr2,File.modPath,File.ffrecPath,File.HVCPath);
        return res;
    }
}
